package cn.zzdt4j.console.controller;

import cn.zzdt4j.common.constant.Constants;
import cn.zzdt4j.common.model.Result;
import cn.zzdt4j.config.model.biz.log.LogRecordQueryReqDTO;
import cn.zzdt4j.config.model.biz.log.LogRecordRespDTO;
import cn.zzdt4j.config.service.biz.OperationLogService;
import cn.zzdt4j.server.common.base.Results;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * The type Log record controller.
 *
 * @author by <a href="mailto:ligang941012@gmail.com">gang.Li</a>
 * @since 2023 /11/14 15:16
 */
@RestController
@AllArgsConstructor
@RequestMapping(Constants.BASE_PATH + "/log")
public class LogRecordController {

    private final OperationLogService operationLogService;

    @PostMapping("/query/page")
    public Result<IPage<LogRecordRespDTO>> queryPage(@RequestBody LogRecordQueryReqDTO reqDTO) {
        return Results.success(operationLogService.queryPage(reqDTO));
    }

}
